<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
<?php
/**
 * Content of m_Ranger CMS.
 * @license MIT License
 * @author Nightlolo
 * @since 1.0
 */

/**
 * Génère le code HTML d'un new à partir d'une classe std.
 * @param stdClass $new
 * @return string
 */
function gen_new($new){
    return '<img class="news" src="'.img_link("img_content/top_news.png").'"/>
            <div id="content_news">
            <div id="content_news_text">
            <img class="avatar_news" src="'.img_link("img_content/avatar_news_vitality.png").'"/>
            <div class="titre"><b>News :</b> '.$new->titre.' </div>
            <div class="text_news">'.$new->contenu.'</div>
            <div class="date">Le '.$new->date.'</div>
            </div>
            </div>
            <img class="news" src="'.img_link("img_content/bottom_news.png").'"/>';
}

/**
 * Génère un contenu simple.
 * @param string $title
 * @param string $content
 * @return string
 */
function gen_simple_content($title, $content){
    return '<img class="news" src="'.img_link("img_content/top_news.png").'"/>
            <div id="content_news">
            <div id="content_news_text">            
            <div class="titre"><b>News :</b> '.$title.' </div>
            <div class="text_news">'.$content.'</div>
            </div>
            </div>
            <img class="news" src="'.img_link("img_content/bottom_news.png").'"/>';
}
?>
